﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Simple.ViewModel;
using Simple.Entity;
using AutoMapper;
using Simple.Entity.Models;

namespace HBootStrap.Admin
{
    public static class MappingExtensions
    {
        #region Sys_User
        public static Sys_User ToEntity(this UserDto dto)
        {
            return Mapper.Map<UserDto, Sys_User>(dto);
        }

        public static UserDto ToDto(this Sys_User dto)
        {
            return Mapper.Map<Sys_User, UserDto>(dto);
        }
        #endregion

        #region Sys_Role
        public static Sys_Role ToEntity(this RoleDto dto)
        {
            return Mapper.Map<RoleDto, Sys_Role>(dto);
        }

        public static RoleDto ToDto(this Sys_Role dto)
        {
            return Mapper.Map<Sys_Role, RoleDto>(dto);
        }
        #endregion

        #region Sys_Menu
        public static Sys_Menu ToEntity(this MenuDto dto)
        {
            return Mapper.Map<MenuDto, Sys_Menu>(dto);
        }

        public static MenuDto ToDto(this Sys_Menu dto)
        {
            return Mapper.Map<Sys_Menu, MenuDto>(dto);
        }
        #endregion

        #region Sys_DataDictionary
        public static Sys_DataDictionary ToEntity(this DataDictionaryDto dto)
        {
            return Mapper.Map<DataDictionaryDto, Sys_DataDictionary>(dto);
        }

        public static DataDictionaryDto ToDto(this Sys_DataDictionary dto)
        {
            return Mapper.Map<Sys_DataDictionary, DataDictionaryDto>(dto);
        }
        #endregion
    }
}